package com.qc.searchBug.controller;


import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qc.searchBug.util.EmaiStateUtil;
import com.qc.searchBug.util.RandomUtil;
import com.qc.searchBug.util.SendEmailUtil;

@Controller
@RequestMapping(value="/sendEmailController")
public class SendEmailController {
	@ResponseBody
	@RequestMapping(value="/sendEmailCode")
	public Object sendEmailCode(@RequestParam String emailAddress,HttpSession session){
		String random = RandomUtil.findRandomNumber();
		String title=EmaiStateUtil.title;
		String content = EmaiStateUtil.findEmailUpdatePwd(random);
		SendEmailUtil.sendSimpleEmail(title, content,emailAddress);
		return random;
	}
}
